function AggregateScalarIRFCollection(SS,IRF,FileName)

%% IRF 1. Aggregate Quantities
ResVarList          =   {'Y','YI','C',...
                         'L','w','q',...
                         'Pi','R','pI'};
ResNameList         =   {'Output','Investment','Consumption',...
                         'Labor','Real Wage','Real Cap. Price',...
                         'Inflation','Nominal Rate','pI'};   
ShockVarList        =   {'eps_Z','eps_D','eps_E'};                     
ShockNameList       =   {'TFP','Debt Fin','Equity Fin'};
LineStyleList       =   {'b:','m--','r-'};
N_col               =   3;
N_row               =   3;
fig_size            =   [N_col*300,N_row*300];
Pos                 =   [50, 50, fig_size];  
subplot_gap         =   [0.06,0.03];
subplot_VMargin     =   [0.03,0.03];
subplot_HMargin     =   [0.03,0.01]; 

TempSubPlotFun      =   @(id)subtightplot(N_row,N_col,id,...
                                          subplot_gap,...
                                          subplot_VMargin,...
                                          subplot_HMargin);
fig         =   figure('Name','IRF of Aggregate Quantities and Price','Position',Pos);
for i_r=1:length(ResVarList)
    ax      =   TempSubPlotFun(i_r);
    Title   =   ResNameList{i_r};
    ResVar  =   ResVarList{i_r};
    if isfield(IRF.(ShockVarList{1}),ResVar)
        for i_s=1:length(ShockVarList)
            irf             =   IRF.(ShockVarList{i_s}).(ResVar);
            if i_s==1
                TempIRF         =   zeros(length(ShockVarList),size(irf,2));
            end
            TempIRF(i_s,:)  =   irf;
            [PH,ax]         =   IRFSoloPlot(TempIRF,LineStyleList,1,ax);

        end
        if i_r==1
            legend(PH,ShockNameList,'fontsize',12,'interpreter','latex');
        end
    end
    title(ax,Title,'interpreter','latex','fontsize',16);
    
end
fig.PaperUnits  =   'points';
fig.PaperSize   =   fig_size;
if nargin>2
    print(fig,[FileName,'_AggQuantPrice'],'-dpdf','-bestfit');
end

%% IRF 2. Aggregate Aucilliary Variables
ResVarList          =   {'Eta_Z','Eta_D','Eta_E',...
                         'A1','A2','B1',...
                         'SDF','AggInt_atK','ysMultiplier'};
ResNameList         =   {'Agg. TFP','Collateral Const.','Equity Fin. Cost',...
                         'A1','A2','B1',...
                         'SDF','K Aggregation','Output Mult.'};   
ShockVarList        =   {'eps_Z','eps_D','eps_E'};                     
ShockNameList       =   {'TFP','Debt Fin','Equity Fin'};
LineStyleList       =   {'b:','m--','r-'};
N_col               =   3;
N_row               =   3;
fig_size            =   [N_col*300,N_row*300];
Pos                 =   [50, 50, fig_size];  
subplot_gap         =   [0.06,0.03];
subplot_VMargin     =   [0.03,0.03];
subplot_HMargin     =   [0.03,0.01]; 

TempSubPlotFun      =   @(id)subtightplot(N_row,N_col,id,...
                                          subplot_gap,...
                                          subplot_VMargin,...
                                          subplot_HMargin);
fig         =   figure('Name','IRF of Auxilliar Variables','Position',Pos);
for i_r=1:length(ResVarList)
    ax      =   TempSubPlotFun(i_r);
    Title   =   ResNameList{i_r};
    ResVar  =   ResVarList{i_r};
    if isfield(IRF.(ShockVarList{1}),ResVar)
        for i_s=1:length(ShockVarList)
            irf             =   IRF.(ShockVarList{i_s}).(ResVar);
            if i_s==1
                TempIRF         =   zeros(length(ShockVarList),size(irf,2));
            end
            TempIRF(i_s,:)  =   irf;
            [PH,ax]         =   IRFSoloPlot(TempIRF,LineStyleList,1,ax);

        end
        if i_r==1
            legend(PH,ShockNameList,'fontsize',12,'interpreter','latex');
        end
    end
    title(ax,Title,'interpreter','latex','fontsize',16);
end
fig.PaperUnits  =   'points';
fig.PaperSize   =   fig_size;
if nargin>2
    print(fig,[FileName,'_AuxVar'],'-dpdf','-bestfit');
end

%% IRF 2. Statistics
% ResNameList         =   {'EFin/K,Small','EFin/K,Large',...
%                          'DFin/K,Small','DFin/K,Large',...
%                          'Iss. Freq.','DFin/Y','EFin/Y',...
%                          'Agg. Leverage'};   
% ShockVarList        =   {'eps_Z','eps_PHI_D','eps_PHI_E'};                     
% ShockNameList       =   {'TFP','Debt Fin','Equity Fin'};
% LineStyleList       =   {'k-','b-.','r--'};
% N_col               =   3;
% N_row               =   3;
% fig_size            =   [N_col*300,N_row*300];
% Pos                 =   [50, 50, fig_size];  
% subplot_gap         =   [0.06,0.03];
% subplot_VMargin     =   [0.03,0.03];
% subplot_HMargin     =   [0.03,0.01]; 
% 
% TempSubPlotFun      =   @(id)subtightplot(N_row,N_col,id,...
%                                           subplot_gap,...
%                                           subplot_VMargin,...
%                                           subplot_HMargin);
% fig         =   figure('Name','IRF of Statistics','Position',Pos);
% for i_r=1:length(ResNameList)
%     ax      =   TempSubPlotFun(i_r);
%     Title   =   ResNameList{i_r};
%     Yabsmax =   0;
%     PH      =   cell(length(ShockVarList),1);
%     for i_s=1:length(ShockVarList)
%         irf             =   IRF.(ShockVarList{i_s}).Aux(i_r,:);
%         [ax,PH{i_s}]    =   PlotScalarIRF(irf,Title,LineStyleList{i_s},ax);
%         if Yabsmax<max(abs(ax.YLim))
%             Yabsmax     =   max(abs(ax.YLim));
%             YabsmaxYLim =   ax.YLim;
%             YabsmaxYTick=   ax.YTick;
%             Exponent    =   ax.YAxis.Exponent;
%         end
%         hold on;
%     end
%     ax.YLim             =   YabsmaxYLim;
%     ax.YTick            =   YabsmaxYTick;
%     ax.YAxis.Exponent   =   Exponent;
%     
%     if i_r==1
%         legend([PH{1},PH{2},PH{3}],ShockNameList,'fontsize',12,'interpreter','latex');
%     end
% end
% fig.PaperUnits  =   'points';
% fig.PaperSize   =   fig_size;
% if nargin>1
%     print(fig,[FileName,'_AuxStat'],'-dpdf','-bestfit');
% end

%% IRF 2. Statistics
ResNameList         =   SS.AuxNameList;
ShockVarList        =   {'eps_Z','eps_D','eps_E'};                     
ShockNameList       =   {'TFP','Debt Fin','Equity Fin'};
LineStyleList       =   {'b:','m--','r-'};
N_col               =   ceil(sqrt(size(IRF.eps_Z.Aux,1)));
N_row               =   ceil(sqrt(size(IRF.eps_Z.Aux,1)));
fig_size            =   [N_col*300,N_row*300];
Pos                 =   [50, 50, fig_size];  
subplot_gap         =   [0.06,0.03];
subplot_VMargin     =   [0.03,0.03];
subplot_HMargin     =   [0.03,0.01]; 

TempSubPlotFun      =   @(id)subtightplot(N_row,N_col,id,...
                                          subplot_gap,...
                                          subplot_VMargin,...
                                          subplot_HMargin);
fig         =   figure('Name','IRF of Statistics, Details','Position',Pos);
for i_r=1:size(IRF.eps_Z.Aux,1)
    ax      =   TempSubPlotFun(i_r);
    Title   =   strrep(ResNameList{i_r},'_','\_');
    for i_s=1:length(ShockVarList)
        irf             =   IRF.(ShockVarList{i_s}).Aux(i_r,:);
        if i_s==1
            TempIRF         =   zeros(length(ShockVarList),size(irf,2));
        end
        TempIRF(i_s,:)  =   irf;
        [PH,ax]         =   IRFSoloPlot(TempIRF,LineStyleList,1,ax);

    end
    
    title(ax,Title,'interpreter','latex','fontsize',16);
    if i_r==1
        legend(PH,ShockNameList,'fontsize',12,'interpreter','latex');
    end
end
fig.PaperUnits  =   'points';
fig.PaperSize   =   fig_size;
if nargin>2
    print(fig,[FileName,'_AuxStat_Details'],'-dpdf','-bestfit');
end